<%@ page import="java.io.*, java.util.*"%>
<%@ page import="java.io.File,
                 java.io.IOException,
                 java.util.Date"
    session="false" %>
<%@taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<c:set var="title" scope="request">Request Properties</c:set>
<jsp:include page="/WEB-INF/jsp/inc/head.jsp" />

<%
Object inetaddress = null;
try {
	inetaddress = java.net.InetAddress.getLocalHost();
} catch(java.net.UnknownHostException e) {
	
} catch(NoClassDefFoundError vE) {
	// GAE restrictions
}
%>
	<ol>
		<li><a href="#requestinfos">Request Informations</a></li>
		<li><a href="#networkinfos">Network Informations</a></li>
		<li><a href="#requestheaders">Request Headers</a></li>
		<li><a href="#requestparams">Request Parameters</a></li>
		<li><a href="#cookies">Cookies</a></li>
	</ol>
	<div>
		<h2>Request Informations<a name="requestinfos"> </a></h2>
		<table>
			<tbody>
				<tr>
					<th>Information</th>
					<th>Value</th>
				</tr>
				<tr>
					<td>Request URL</td>
					<td><%=request.getRequestURL()%></td>
				</tr>
				<tr>
					<td>Request URI</td>
					<td><%=request.getRequestURI()%></td>
				</tr>
				<tr>
					<td>Path Info</td>
					<td><%=request.getPathInfo()%></td>
				</tr>
				<tr>
					<td>Character Encoding</td>
					<td><%=request.getCharacterEncoding()%></td>
				</tr>
				<tr>
					<td>Path Translated</td>
					<td><%=request.getPathTranslated()%></td>
				</tr>
				<tr>
					<td>Auth Type</td>
					<td><%=request.getAuthType()%></td>
				</tr>
			</tbody>
		</table>
		<h2>Network Informations<a name="networkinfos"> </a></h2>
		<table>
			<tbody>
				<tr>
					<th>Remote IP</th>
			        <th>Remote Host</th>
			        <th>Server Name</th>
			        <th>Server Port</th>
			        <% if (inetaddress!=null) { %>
			        <th>Inet Adress</th>
			        <th>Inet Host</th>
			        <th>Inet Canonical Host</th>
			        <% } %>
			        <th>Protocol</th>
			        <th>Scheme</th>
			        <th>User Principal</th>
				</tr>
				<tr>
			        <td><%=request.getRemoteAddr()%></td>
			        <td><%=request.getRemoteHost()%></td>
			        <td><%=request.getServerName()%></td>
			        <td><%=request.getServerPort()%></td>
			        <% if (inetaddress!=null) { %>
			        <td><%=((java.net.InetAddress)inetaddress).getHostAddress()%></td>
			        <td><%=((java.net.InetAddress)inetaddress).getHostName()%></td>
			        <td><%=((java.net.InetAddress)inetaddress).getCanonicalHostName()%></td>
			        <% } %>
			        <td><%=request.getProtocol()%></td>
			        <td><%=request.getScheme()%></td>
			        <td><%=request.getUserPrincipal()%></td>
			    </tr>
			</tbody>
		</table>

		<h2>Request Headers<a name="requestheaders"> </a></h2>
		<table>
			<tbody>
				<tr>
					<th>key</th>
					<th>value</th>
				</tr>
				<c:forEach var="entry" items="${header}">
				<tr>
					<td><c:out value="${entry.key}" /></td>
					<td><c:out value="${entry.value}" /></td>
				</tr>
				</c:forEach>
			</tbody>
		</table>
		
		<h2>Request Parameters<a name="requestparams"> </a></h2>
		<table>
			<tbody>
				<tr>
					<th>key</th>
					<th>value</th>
				</tr>
				<c:forEach var="entry" items="${param}">
				<tr>
					<td><c:out value="${entry.key}" /></td>
					<td><c:out value="${entry.value}" /></td>
				</tr>
				</c:forEach>
			</tbody>
		</table>
		<h2>Cookies<a name="cookies"> </a></h2>
		<table>
			<tbody>
				<tr>
					<th>key</th>
					<th>value</th>
					<th>domain</th>
					<th>path</th>
					<th>maxage</th>
					<th>secure</th>
					<th>version</th>
					<th>comment</th>
				</tr>
				<c:forEach var="entry" items="${cookie}">
				<tr>
					<td><c:out value="${entry.key}" /></td>
					<td><c:out value="${entry.value.value}" /></td>
					<td><c:out value="${entry.value.domain}" /></td>
					<td><c:out value="${entry.value.path}" /></td>
					<td><c:out value="${entry.value.maxAge}" /></td>
					<td><c:out value="${entry.value.secure}" /></td>
					<td><c:out value="${entry.value.version}" /></td>
					<td><c:out value="${entry.value.comment}" /></td>
				</tr>
				</c:forEach>
			</tbody>
		</table>
	</div>
	

<jsp:include page="/WEB-INF/jsp/inc/foot.jsp" />